<?php
class MessagingHelper {
	public static function AddToError(&$response_arr,$code,$msg) {
		if (isset($response_arr['error'])) {
			$response_arr['error'][] =  array('error_code' => $code,'error_msg' => $msg);
		} else {
			$response_arr['error'] = array('error_code' => $code,'error_msg' => $msg);
		}
		return $response_arr;
	}
	
	public static function AddToData(&$response_arr,$msg) {
		$response_arr['data'] = $msg;
		return $response_arr;
	}
	
	public static function AddToCurrentData(&$response_arr,$msg) {
		array_push($response_arr['data'], $msg);
		return $response_arr;
	}
	
	public static function AddToCurrentError(&$response_arr,$code,$msg) {
		array_push($response_arr['error'], $msg);
		return $response_arr;
	}
	
} 